package cn.ml.sboot11.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ThreadServiceImpl {

    // 指定使用beanname为 doExecutor 的线程池
    @Async("doExecutor")
    public String doLong(String msg){
        log.info("do long...msg={}",msg);
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            log.error("do long error:",e);
        }
        return msg;
    }


}
